{% extends 'database/base.html' %}

{% block title_content %}订单信息{% endblock %}

{% block body_content %}
<h1 class="display-1">客户{{name}}的订单列表</h1>
    <table class="table">
        <thead>
            <tr>
                <th>订单ID</th>
                <th>订餐时间</th>
                <th>菜品</th>
                <th>数量</th>
                <th>总价格</th>
                <th>订单状态</th>
                <th>详细信息</th>
            </tr>
        </thead>
        <tbody>
            {% for item in object_list %}
            <tr>
                <td>{{ item.id }}</td>
                <td>{{ item.orderTime }}</td>
                <td>{{ item.food_name }}</td>
                <td>{{ item.amount }}</td>
                <td>{{ item.totalPrice }}</td>
                <td>{{ item.state|yesno:"已完成,未完成" }}</td>
                <td><a href="{% url 'delivery_database:normal_user_order_detail' id item.pk %}" >点击查看</a></td>
            </tr>
            {% empty %}
                <tr>
                    <td colspan="4">暂无数据</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
<p>
    <a class="btn btn-primary" href="{% url 'delivery_database:normal_user_menu' id %}">返回</a>
</p>
{% endblock %}